/**
 * @see https://umijs.org/zh-CN/plugins/plugin-access
 * */
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
  const {currentUser} = initialState ?? {};
  // @ts-ignore
  return {normalRouteFilter: (route: any) => currentUser && currentUser.page.includes(route.key),};
}
